exports.install = function (Vue, options) {
  Vue.prototype.$config = {
    iswx(){
      var ua = window.navigator.userAgent.toLowerCase();
      if(ua.match(/MicroMessenger/i) == 'micromessenger'){
        return true;
      }else{
        return false;
      }
    },
    wxshare (wxconfig){
      var config = wxconfig,
        title = "一句话证明你近视，赢34000元全飞秒激光手术做德视佳眼健康代言人！",
        summary = "你的亮眼大着数已经上线，千万不要放过TA！",
        link = "http://h5.oeeee.com/h5/desj/",
        thumb = 'http://h5.oeeee.com/h5/desj/static/img/wxshare.jpg',
        content = {
          title: title,
          desc:summary,
          link: link,
          imgUrl:thumb,
          type: '',
          dataUrl: '',
          success: function () {},
          cancel: function () {}
        }

      wx.config({
        debug: false,
        appId: config.appId,
        timestamp: config.timestamp,
        nonceStr: config.nonceStr,
        signature: config.signature,
        jsApiList: [
          'onMenuShareAppMessage','onMenuShareTimeline','onMenuShareQQ','onMenuShareWeibo'
        ]
      });
      wx.checkJsApi({
        jsApiList: ['onMenuShareAppMessage','onMenuShareTimeline','onMenuShareQQ','onMenuShareWeibo'],
        success: function(res) {}
      });
      wx.ready(function () {
        wx.onMenuShareAppMessage(content);
        wx.onMenuShareTimeline(content);
        wx.onMenuShareQQ(content);
        wx.onMenuShareWeibo(content);
      });
    },
    init(){
      if(this.iswx()){
        this.wxshare(oe_wxconfig);
      }
    }
  };
}
